package cn.bootx.table.modify.mysql.base;

import cn.bootx.table.modify.annotation.DbColumn;
import cn.bootx.table.modify.annotation.DbComment;
import cn.bootx.table.modify.annotation.DbTable;
import cn.bootx.table.modify.mysql.annotation.DbMySqlFieldType;
import cn.bootx.table.modify.mysql.constants.MySqlFieldTypeEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 基础注解创建表 (不开启简单建表模式)
 * @author xxm
 * @date 2023/6/2
 */
@Data
@DbTable(isSimple = false,comment = "基础注解创建表",name = "base_db_entity")
public class BaseDbEntity {

    @DbColumn(name = "name",comment = "名称")
    private String name;

    @DbMySqlFieldType(MySqlFieldTypeEnum.LONGTEXT)
    @DbColumn(name = "text",comment = "长文本")
    private String text;

    @DbComment("浮点类型")
    @DbMySqlFieldType(MySqlFieldTypeEnum.DECIMAL)
    private BigDecimal bigDecimal;

    @DbComment("浮点类型2")
    @DbColumn(length = 5, precision = 3)
    @DbMySqlFieldType(MySqlFieldTypeEnum.DECIMAL)
    private BigDecimal bigDecimal2;

    @DbColumn(comment = "时间日期")
    private Date dateTime;

    @DbColumn(comment = "java8时间")
    private LocalDateTime localDateTime;

    @DbMySqlFieldType(MySqlFieldTypeEnum.TIMESTAMP)
    @DbComment("时间戳")
    private Long timestamp;

}
